import java.io.*;
import java.util.Iterator;
import java.util.Set;
public class Output {
    Input input=new Input();
    String  path= input.getPathForWrite();
    public void write(Set wordsForWrite) throws IOException,FileNotFoundException {
        File fileForWrite= new File(path);
        FileOutputStream FOS=new FileOutputStream(fileForWrite,true);
        OutputStreamWriter OSW=new OutputStreamWriter(FOS,"Cp1251");
        BufferedWriter BW=new BufferedWriter(OSW);
        for (Iterator<String> it = wordsForWrite.iterator(); it.hasNext();)
        {
            String writingWord=it.next();
            BW.append(writingWord + "," + " ");
        }
        BW.newLine();
        BW.flush();
        BW.close();
    }
}
